Skip to content

[browser][coreCLR] fix streaming instatiation for NodeJS#123332

Merged
pavelsavara merged 6 commits intodotnet:mainfrom
pavelsavara:browser_fetchlike
Jan 19, 2026
Merged

[browser][coreCLR] fix streaming instatiation for NodeJS#123332
pavelsavara merged 6 commits intodotnet:mainfrom
pavelsavara:browser_fetchlike

Conversation

@pavelsavara
Copy link
Member

  • use real Response class when possible

@pavelsavara pavelsavara added this to the 11.0.0 milestone Jan 18, 2026
@pavelsavara pavelsavara self-assigned this Jan 18, 2026
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-Host os-browser Browser variant of arch-wasm labels Jan 18, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @jeffschwMSFT, @elinor-fung
See info in area-owners.md if you want to be subscribed.

@pavelsavara pavelsavara marked this pull request as ready for review January 19, 2026 10:26
Copilot AI review requested due to automatic review settings January 19, 2026 10:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes streaming instantiation for Node.js by introducing a responseLike helper function that uses the real Response class when available, and provides appropriate Content-Type headers for assets to enable proper WebAssembly streaming.

Changes:

  • Introduced a responseLike function that uses the native Response constructor when available, with proper fallback for environments without it
  • Added expectedContentType parameter to fetchLike and thread it through to responses for proper WASM Content-Type headers
  • Created behaviorToContentTypeMap to map asset behaviors to their MIME types
  • Renamed runtimeToBlazorAssetTypeMap to behaviorToBlazorAssetTypeMap for better naming consistency

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/native/corehost/browserhost/loader/polyfills.ts Added responseLike helper function, updated fetchLike to accept and use expectedContentType, refactored response creation to use the helper
src/native/corehost/browserhost/loader/assets.ts Added behaviorToContentTypeMap, renamed asset type mapping for consistency, updated loadResourceFetch to use content types and responseLike

@pavelsavara
Copy link
Member Author

/ba-g known issues

@pavelsavara pavelsavara merged commit 1af7e1a into dotnet:main Jan 19, 2026
34 of 39 checks passed
@pavelsavara pavelsavara deleted the browser_fetchlike branch January 19, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Host os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants